home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / technote / tchntstc.sit / Technical Notes Stack 3.2.1 / Technical Notes Stack 3.2.1 / background_2711.txt < prev    next >
Encoding:
Text File  |  1990-01-08  |  26.0 KB  |  1,045 lines

  1. -- background: 2711 from stack: in.1
  2. -- bmap block id: 3879
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Main
  6. ----- HyperTalk script -----
  7. -- HANDLERS: openCard, closeCard, openBackground, lockUnlock, xref
  8.  
  9. on openBackground
  10.   set icon of bg btn "Number" to "Number"
  11.   set icon of bg btn "Date" to "Date"
  12.   set icon of bg btn "Subject" to "Subject"
  13.   set icon of bg btn "Index" to "Index"
  14. end openBackground
  15.  
  16. -----------------
  17. -- openCard handler
  18. -----------------
  19. on openCard
  20.   global entries,hometo,navpath
  21.   add 1 to entries
  22.   if entries = 1 then    -- first time in this bg
  23.     set scroll of fld "text" to 0
  24.     set lockText of fld "text" to true
  25.     set icon of bg btn "lockUnlock" to "locked"
  26.   end if
  27.   -- Set up the Home button
  28.   homeicon
  29.   -- Set up the arrow buttons
  30.   if the short id of this cd = the short id of first cd of this bg then
  31.     set icon of bg btn "Prev" to "angleleft.black Off"
  32.     set icon of bg btn "Next" to "angleright.black"
  33.     set autohilite of bg btn "Prev" to false
  34.     set autohilite of bg btn "Next" to true
  35.   else
  36.     if the short id of this cd = the short id of last cd of this bg then
  37.       set icon of bg btn "Next" to "angleright.black Off"
  38.       set icon of bg btn "Prev" to "angleleft.black"
  39.       set autohilite of bg btn "Next" to false
  40.       set autohilite of bg btn "Prev" to true
  41.     else
  42.       set icon of bg btn "Next" to "angleright.black"
  43.       set icon of bg btn "Prev" to "angleleft.black"
  44.       set autohilite of bg btn "Next" to true
  45.       set autohilite of bg btn "Prev" to true
  46.     end if
  47.   end if
  48.   -- Set up the Xref and Illustration buttons
  49.   if bg fld "xrefList" is empty then
  50.     set icon of bg button "Help" to "XRef Off"
  51.   else
  52.     set icon of bg button "Help" to "XRef"
  53.   end if
  54.   if bg fld "menuList" is empty then
  55.     set icon of bg button "Illustration" to "Illustration Off"
  56.   else
  57.     set icon of bg button "Illustration" to "Illustration"
  58.   end if
  59. end openCard
  60.  
  61. on closeCard
  62.   hide bg fld "Xreflist"
  63.   hide bg fld "menulist"
  64.   hide bg button "bMask"
  65.   set hilite of bg btn "Help" to false
  66.   set hilite of bg btn "Illustration" to false
  67.   lockUnlock "lock"
  68.   set scroll of bkgnd field "Text" to 0
  69.   pop card into backfrom
  70.   push card
  71. end closeCard
  72.  
  73. on lockUnlock what
  74.   global theSavedText
  75.   if theSavedText is not empty AND bkgnd field "text" is not theSavedText then
  76.     answer "Save changes to this Note?" with "Yes" or "No" or "Cancel"
  77.     if it is "Cancel" then exit lockUnlock
  78.     else
  79.       if it is "No" then put theSavedText into bkgnd field "text"
  80.     end if
  81.   end if
  82.   if what is "lock" OR the icon of bkgnd btn "lockUnlock" is 105 then
  83.     set the locktext of bkgnd field "text" to true
  84.     set the icon of bkgnd btn "lockUnlock" to "locked"
  85.     put empty into theSavedText
  86.   else
  87.     set the locktext of bkgnd field "text" to false
  88.     set the icon of bkgnd btn "lockUnlock" to "unlocked"
  89.     put bkgnd field "text" into theSavedText
  90.   end if
  91. end lockUnlock
  92.  
  93. -------------------
  94. -- xref handler
  95. -------------------
  96. -- for use with SpInside Macintosh and Q & A Stack
  97. -- passed a chapter abbreviation, it finds the chapter
  98. -- number with chaptonum() then the chapter location with
  99. -- findchapter or passed the Q & A Stack Name
  100. -- it goes to the Q & A Stack
  101.  
  102. on xref which
  103.   global SpInsideMacName, QAStackName, homeTo,SMKRSflag
  104.   if SpInsideMacName is empty then setupxrefname
  105.   if QAStackName is empty then setupQAname
  106.   lock screen
  107.   set lockmessages to true
  108.   if which is empty then exit xref
  109.   put hometo into savehometo
  110.   put (long id of this card) & return before homeTo
  111.   push card
  112.   set cursor to busy
  113.   --
  114.   if which = "Q & A Stack" then
  115.     go stack QAstackname
  116.     if line 1 of the script of this stack contains "Q & A Stack" then
  117.       set lockmessages to false
  118.       findQA
  119.       unlock screen with iris open
  120.       exit to HyperCard
  121.     else
  122.       answer "CanΓÇÖt find ΓÇ£Q & A StackΓÇ¥"
  123.       pop card
  124.       put savehometo into hometo
  125.       set lockmessages to false
  126.       unlock screen
  127.       exit xref
  128.     end if
  129.   else
  130.     --
  131.     go stack SpInsideMacName
  132.     --
  133.     if line 1 of the script of this stack contains "SpInside Macintosh" then
  134.       get findChapter(string2index(which))
  135.       if it is not empty then
  136.         set lockMessages to false
  137.         go card it
  138.         checkKRS  -- set up KRS if it is there
  139.         if SMKRSflag = "true" then push line 1 of homeTo
  140.         unlock screen with iris open
  141.         exit to HyperCard
  142.       else
  143.         answer "Can't find referenced chapter" with "OK"
  144.         pop card
  145.         put savehometo into hometo
  146.         set lockmessages to false
  147.         unlock screen
  148.         exit to HyperCard
  149.       end if
  150.     else
  151.       answer "CanΓÇÖt find ΓÇ£SpInside MacintoshΓÇ¥"
  152.       pop card
  153.       put savehometo into hometo
  154.       set lockmessages to false
  155.       unlock screen
  156.       exit xref
  157.     end if
  158.   end if -- Q & A or SpInside Mac?
  159.   set lockmessages to false
  160.   unlock screen
  161. end xref
  162.  
  163. -----------------
  164. -- displayPict handler
  165. -----------------
  166. on displayPict
  167.   global pictPath,thePict,pictresult
  168.   if pictPath is empty then getPath
  169.   put pictPath & thePict into whom
  170.   TNPict whom,1,0
  171.   if the result contains "Error" then
  172.     put the result into pictresult
  173.     delete word 1 of pictresult
  174.     respondpolitely
  175.   end if
  176. end displayPict
  177.  
  178. -----------------
  179. -- getPath handler
  180. -----------------
  181. on getPath
  182.   global pictPath
  183.   get the long name of this stack
  184.   delete char 1 to 7 of it
  185.   repeat until last char of it is ":"
  186.     delete last char of it
  187.   end repeat
  188.   put "Tech Note PICTs:" after it
  189.   put it into pictPath
  190. end getPath
  191.  
  192. -----------------
  193. -- respondPolitely handler
  194. -----------------
  195. on respondPolitely
  196.   global thePict,pictresult
  197.   if pictresult contains "found" then
  198.     put "File not found:  " & thePict & return & return & "It must be in a folder named ΓÇ£Tech Note PICTs,ΓÇ¥ " & "which must be at the same level as this stack." into errmsg
  199.   else
  200.     if pictresult contains "memory" then
  201.       put "Not enough memory to open file:" & return & return & thePict into errmsg
  202.     else
  203.       if pictresult contains "operation" then
  204.         put "User canceled operation" into errmsg
  205.       else
  206.         put thePict &" could not be opened" into errmsg
  207.       end if
  208.     end if
  209.   end if
  210.   get dialog(errmsg,"OK",1,Chicago,Plain,12)
  211. end respondPolitely
  212.  
  213. -------------------
  214. -- arrowKey handler for Main bg
  215. -------------------
  216. on arrowKey key
  217.   if key is "right" then
  218.     send goNext to bg btn "Next"
  219.   else if key is "left" then
  220.     send goPrev to bg btn "Prev"
  221.   else if key is "up" then
  222.     if the optionKey is "down" then
  223.       pass arrowKey
  224.       exit arrowKey
  225.     else
  226.       click at 498,58
  227.     end if
  228.   else if key is "down" then
  229.     if the optionKey is "down" then
  230.       pass arrowKey
  231.       exit arrowKey
  232.     else
  233.       click at 498,305
  234.     end if
  235.   end if
  236. end arrowKey
  237.  
  238.  
  239. -- part 53 (button)
  240. -- low flags: 00
  241. -- high flags: 0002
  242. -- rect: left=3 top=52 right=312 bottom=508
  243. -- title width / last selected line: 0
  244. -- icon id / first selected line: 0 / 0
  245. -- text alignment: 1
  246. -- font id: 0
  247. -- text size: 12
  248. -- style flags: 0
  249. -- line height: 16
  250. -- part name: Mask
  251.  
  252.  
  253. -- part 44 (button)
  254. -- low flags: 00
  255. -- high flags: 0002
  256. -- rect: left=3 top=22 right=47 bottom=508
  257. -- title width / last selected line: 0
  258. -- icon id / first selected line: 0 / 0
  259. -- text alignment: 1
  260. -- font id: 0
  261. -- text size: 12
  262. -- style flags: 0
  263. -- line height: 16
  264. -- part name: mask
  265.  
  266.  
  267. -- part 52 (button)
  268. -- low flags: 00
  269. -- high flags: 0002
  270. -- rect: left=5 top=24 right=45 bottom=506
  271. -- title width / last selected line: 0
  272. -- icon id / first selected line: 0 / 0
  273. -- text alignment: 1
  274. -- font id: 0
  275. -- text size: 12
  276. -- style flags: 0
  277. -- line height: 16
  278. -- part name: Mask
  279.  
  280.  
  281. -- part 9 (field)
  282. -- low flags: 01
  283. -- high flags: 0007
  284. -- rect: left=5 top=54 right=310 bottom=506
  285. -- title width / last selected line: 0
  286. -- icon id / first selected line: 0 / 0
  287. -- text alignment: 0
  288. -- font id: 22
  289. -- text size: 10
  290. -- style flags: 0
  291. -- line height: 13
  292. -- part name: Text
  293.  
  294.  
  295. -- part 2 (field)
  296. -- low flags: 01
  297. -- high flags: 0000
  298. -- rect: left=5 top=24 right=45 bottom=50
  299. -- title width / last selected line: 0
  300. -- icon id / first selected line: 0 / 0
  301. -- text alignment: 0
  302. -- font id: 2
  303. -- text size: 12
  304. -- style flags: 8448
  305. -- line height: 20
  306. -- part name: Number
  307.  
  308.  
  309. -- part 7 (field)
  310. -- low flags: 01
  311. -- high flags: 0000
  312. -- rect: left=49 top=24 right=45 bottom=480
  313. -- title width / last selected line: 0
  314. -- icon id / first selected line: 0 / 0
  315. -- text alignment: 0
  316. -- font id: 2
  317. -- text size: 12
  318. -- style flags: 8448
  319. -- line height: 20
  320. -- part name: Title
  321.  
  322.  
  323. -- part 28 (button)
  324. -- low flags: 00
  325. -- high flags: 2004
  326. -- rect: left=257 top=316 right=341 bottom=282
  327. -- title width / last selected line: 0
  328. -- icon id / first selected line: 113 / 113
  329. -- text alignment: 1
  330. -- font id: 0
  331. -- text size: 12
  332. -- style flags: 0
  333. -- line height: 16
  334. -- part name: Next
  335. ----- HyperTalk script -----
  336. on mouseDown
  337.   goNext
  338.   repeat while the mouse is down AND the mouseLoc is within rect of me
  339.     goNext
  340.   end repeat
  341. end mouseDown
  342.  
  343. -----------------
  344. -- goNext handler for Main Bg
  345. -----------------
  346. on goNext
  347.   if the optionKey is "down" then
  348.     if the number of this cd < the number of last cd of this bg then
  349.       put the long id of this card into backfrom -- push it later
  350.       put bg fld "number" into cardNum
  351.       if the number of chars in cardNum > 3 then
  352.         delete char 4 of cardNum
  353.         if cardNum Γëá char 1 to 3 of bg fld "number" of next card then
  354.           visual effect wipe left
  355.           go next card
  356.         else
  357.           set cursor to busy
  358.           set lockmessages to true
  359.           lock screen
  360.           --
  361.           repeat until cardNum is not in bg fld "number" of next card
  362.             go next card
  363.           end repeat
  364.           --
  365.           set lockmessages to false
  366.           go next card
  367.           push backfrom
  368.           unlock screen with visual effect wipe left
  369.         end if
  370.       else
  371.         visual effect wipe left
  372.         go next card
  373.       end if
  374.     else
  375.       visual effect wipe left
  376.       go next card
  377.     end if
  378.   else -- no option key down
  379.     if the number of this card < the number of last card of this bg then
  380.       visual effect wipe left
  381.       go next card
  382.     end if
  383.   end if
  384. end goNext
  385.  
  386.  
  387. -- part 29 (button)
  388. -- low flags: 00
  389. -- high flags: 2004
  390. -- rect: left=228 top=316 right=341 bottom=253
  391. -- title width / last selected line: 0
  392. -- icon id / first selected line: 111 / 111
  393. -- text alignment: 1
  394. -- font id: 0
  395. -- text size: 12
  396. -- style flags: 0
  397. -- line height: 16
  398. -- part name: Prev
  399. ----- HyperTalk script -----
  400. on mouseDown
  401.   goPrev
  402.   repeat while the mouse is down AND the mouseLoc is within rect of me
  403.     goPrev
  404.   end repeat
  405. end mouseDown
  406.  
  407. -----------------
  408. -- goPrev handler for Main Bg
  409. -----------------
  410. on goPrev
  411.   if the optionKey is "down" then
  412.     if the number of this card > the number of first card of this bg then
  413.       put the long id of this card into backfrom -- push it later
  414.       put bg fld "number" into cardNum
  415.       set lockmessages to true
  416.       lock screen
  417.       if the number of chars in cardNum > 3 then
  418.         delete char 4 of cardNum
  419.         if cardNum = char 1 to 3 of bg fld "number" of prev card then
  420.           unlock screen
  421.           set cursor to busy -- purely cosmetic
  422.           lock screen
  423.           repeat until cardNum is not in bg fld "number" of prev card
  424.             go prev card
  425.           end repeat
  426.         end if
  427.       end if
  428.       -- now at first cd of this chap
  429.       if the number of chars in bg fld "number" of prev card > 3 then
  430.         go prev card
  431.         put char 1 to 3 of bg fld "number" into cardNum
  432.         repeat until char 4 of bg fld "number" = "b" -- second card
  433.           go prev card
  434.         end repeat
  435.       end if
  436.       --
  437.       set lockmessages to false
  438.       go previous card
  439.       push backfrom
  440.       unlock screen with visual effect wipe right
  441.     else
  442.       visual effect wipe right
  443.       go prev card
  444.     end if
  445.   else -- no option key down
  446.     if the number of this card > the number of first card of this bg then
  447.       visual effect wipe right
  448.       go prev card
  449.     end if
  450.   end if
  451. end goPrev
  452.  
  453.  
  454.  
  455. -- part 80 (button)
  456. -- low flags: 00
  457. -- high flags: 0000
  458. -- rect: left=490 top=28 right=40 bottom=502
  459. -- title width / last selected line: 0
  460. -- icon id / first selected line: 104 / 104
  461. -- text alignment: 1
  462. -- font id: 0
  463. -- text size: 12
  464. -- style flags: 0
  465. -- line height: 16
  466. -- part name: lockUnlock
  467. ----- HyperTalk script -----
  468. on mouseUp
  469.   lockUnlock
  470. end mouseUp
  471.  
  472.  
  473.  
  474.  
  475. -- part 87 (button)
  476. -- low flags: 00
  477. -- high flags: 2004
  478. -- rect: left=3 top=316 right=341 bottom=39
  479. -- title width / last selected line: 0
  480. -- icon id / first selected line: 106 / 106
  481. -- text alignment: 1
  482. -- font id: 3
  483. -- text size: 9
  484. -- style flags: 0
  485. -- line height: 12
  486. -- part name: Home
  487. ----- HyperTalk script -----
  488. on mouseUp
  489.   gohome
  490. end mouseUp
  491.  
  492. -----------------
  493. -- gohome handler
  494. -----------------
  495. --
  496. -- gohome uses a stack structure
  497. --
  498. on gohome
  499.   global homeTo, nav_path, navpath
  500.   lock screen
  501.   --
  502.   if the optionKey is "down" then
  503.     set icon of bg btn "Home" to "Home"
  504.     go Home
  505.     exit gohome
  506.   end if
  507.   --
  508.   -- If from NavStack on CD
  509.   --
  510.   if navpath = "true" then
  511.     --
  512.     put (item 1 of the clickLoc) - (item 1 of the Loc of bg btn "Home") into E
  513.     --
  514.     -- Go to Feedback Stack
  515.     --
  516.     if E < 0 then
  517.       push card
  518.       put the long name of stack "Home" into NewName
  519.       delete char 1 to 7 of NewName
  520.       repeat
  521.         if not(NewName contains ":") then
  522.           exit repeat
  523.         else
  524.           put char 1 to offset(":",NewName) of NewName after NewPath
  525.           delete char 1 to offset(":",NewName) of NewName
  526.         end if
  527.       end repeat
  528.       put NewPath & "P&D Feedback" into feedPath
  529.       set cursor to busy
  530.       visual effect dissolve fast
  531.       go stack feedPath
  532.     else
  533.       --
  534.       -- Return to NavStack if launched from there
  535.       --
  536.       if E > 0 then
  537.         visual effect iris close to black
  538.         visual effect iris open
  539.         get line 1 of homeTo
  540.         delete line 1 of homeTo
  541.         delete line 1 of nav_path
  542.         --
  543.         go it -- former line 1 of homeTo
  544.       end if
  545.     end if
  546.   else
  547.     --
  548.     -- Normal operation below
  549.     --
  550.     repeat
  551.       get line 1 of homeTo
  552.       delete line 1 of homeTo     -- pop stack
  553.       if it is empty then
  554.         exit repeat
  555.       else
  556.         visual effect iris close
  557.         go it
  558.         exit gohome
  559.       end if
  560.     end repeat
  561.     visual effect iris close
  562.     go Home
  563.   end if
  564. end gohome
  565.  
  566.  
  567.  
  568. -- part 88 (button)
  569. -- low flags: 00
  570. -- high flags: 2004
  571. -- rect: left=474 top=316 right=341 bottom=510
  572. -- title width / last selected line: 0
  573. -- icon id / first selected line: 7417 / 7417
  574. -- text alignment: 1
  575. -- font id: 3
  576. -- text size: 9
  577. -- style flags: 0
  578. -- line height: 12
  579. -- part name: Back
  580. ----- HyperTalk script -----
  581. on mouseUp
  582.   goBack
  583. end mouseUp
  584.  
  585.  
  586.  
  587. -- part 91 (button)
  588. -- low flags: 00
  589. -- high flags: 2004
  590. -- rect: left=55 top=316 right=341 bottom=91
  591. -- title width / last selected line: 0
  592. -- icon id / first selected line: 115 / 115
  593. -- text alignment: 1
  594. -- font id: 3
  595. -- text size: 9
  596. -- style flags: 0
  597. -- line height: 12
  598. -- part name: Number
  599. ----- HyperTalk script -----
  600. on mouseUp
  601.   lock screen
  602.   set cursor to busy
  603.   go card id 23921 -- NumberListing
  604.   unlock screen with iris close
  605. end mouseUp
  606.  
  607.  
  608. -- part 92 (button)
  609. -- low flags: 00
  610. -- high flags: 2004
  611. -- rect: left=137 top=316 right=341 bottom=173
  612. -- title width / last selected line: 0
  613. -- icon id / first selected line: 119 / 119
  614. -- text alignment: 1
  615. -- font id: 3
  616. -- text size: 9
  617. -- style flags: 0
  618. -- line height: 12
  619. -- part name: Subject
  620. ----- HyperTalk script -----
  621. on mouseUp
  622.   lock screen
  623.   set cursor to busy
  624.   go card id 22110 -- Subject Listing
  625.   unlock screen with iris close
  626. end mouseUp
  627.  
  628.  
  629.  
  630. -- part 93 (button)
  631. -- low flags: 00
  632. -- high flags: 2004
  633. -- rect: left=178 top=316 right=341 bottom=214
  634. -- title width / last selected line: 0
  635. -- icon id / first selected line: 121 / 121
  636. -- text alignment: 1
  637. -- font id: 3
  638. -- text size: 9
  639. -- style flags: 0
  640. -- line height: 12
  641. -- part name: Index
  642. ----- HyperTalk script -----
  643. on mouseUp
  644.   lock screen
  645.   set cursor to busy
  646.   go card id 63924 -- IndexListing
  647.   unlock screen with iris close
  648. end mouseUp
  649.  
  650.  
  651.  
  652. -- part 96 (button)
  653. -- low flags: 00
  654. -- high flags: 2004
  655. -- rect: left=444 top=316 right=341 bottom=469
  656. -- title width / last selected line: 0
  657. -- icon id / first selected line: 131 / 131
  658. -- text alignment: 1
  659. -- font id: 0
  660. -- text size: 12
  661. -- style flags: 0
  662. -- line height: 16
  663. -- part name: Print
  664. ----- HyperTalk script -----
  665. on mouseUp
  666.   goPrintIt
  667. end mouseUp
  668.  
  669.  
  670.  
  671.  
  672. -- part 97 (button)
  673. -- low flags: 00
  674. -- high flags: 2004
  675. -- rect: left=384 top=316 right=341 bottom=409
  676. -- title width / last selected line: 0
  677. -- icon id / first selected line: 129 / 129
  678. -- text alignment: 1
  679. -- font id: 0
  680. -- text size: 12
  681. -- style flags: 0
  682. -- line height: 16
  683. -- part name: Find
  684. ----- HyperTalk script -----
  685. on mouseUp
  686.   global findText
  687.   if the selection is not empty then
  688.     put the selection into findText
  689.     select empty
  690.   end if
  691.   doMenu "Find..."
  692. end mouseUp
  693.  
  694.  
  695.  
  696. -- part 101 (button)
  697. -- low flags: 00
  698. -- high flags: 2004
  699. -- rect: left=354 top=316 right=341 bottom=379
  700. -- title width / last selected line: 0
  701. -- icon id / first selected line: 130 / 130
  702. -- text alignment: 1
  703. -- font id: 0
  704. -- text size: 12
  705. -- style flags: 0
  706. -- line height: 16
  707. -- part name: GoNote
  708. ----- HyperTalk script -----
  709. on mouseUp
  710.   goNote
  711. end mouseUp
  712.  
  713.  
  714.  
  715. -- part 109 (button)
  716. -- low flags: 00
  717. -- high flags: 2004
  718. -- rect: left=414 top=316 right=341 bottom=439
  719. -- title width / last selected line: 0
  720. -- icon id / first selected line: 127 / 127
  721. -- text alignment: 1
  722. -- font id: 0
  723. -- text size: 12
  724. -- style flags: 0
  725. -- line height: 16
  726. -- part name: Disk
  727. ----- HyperTalk script -----
  728. on mouseUp
  729.   goSaveIt
  730. end mouseUp
  731.  
  732.  
  733.  
  734.  
  735.  
  736. -- part 114 (button)
  737. -- low flags: 00
  738. -- high flags: 2004
  739. -- rect: left=96 top=316 right=341 bottom=132
  740. -- title width / last selected line: 0
  741. -- icon id / first selected line: 117 / 117
  742. -- text alignment: 1
  743. -- font id: 3
  744. -- text size: 9
  745. -- style flags: 0
  746. -- line height: 12
  747. -- part name: Date
  748. ----- HyperTalk script -----
  749. on mouseUp
  750.   lock screen
  751.   set cursor to busy
  752.   go card id 76061 -- DateListing/Contents Listing
  753.   unlock screen with iris close
  754. end mouseUp
  755.  
  756.  
  757.  
  758. -- part 112 (button)
  759. -- low flags: 80
  760. -- high flags: 0000
  761. -- rect: left=0 top=0 right=342 bottom=512
  762. -- title width / last selected line: 0
  763. -- icon id / first selected line: 0 / 0
  764. -- text alignment: 1
  765. -- font id: 0
  766. -- text size: 12
  767. -- style flags: 0
  768. -- line height: 16
  769. -- part name: bMask
  770. ----- HyperTalk script -----
  771. on mouseUp
  772.   hide bg field "xrefList"
  773.   hide bg field "menuList"
  774.   set hilite of bg button "Help" to false
  775.   set hilite of bg button "Illustration" to false
  776.   hide bg button "bMask"
  777. end mouseUp
  778.  
  779.  
  780. -- part 95 (button)
  781. -- low flags: 00
  782. -- high flags: 0004
  783. -- rect: left=324 top=316 right=341 bottom=349
  784. -- title width / last selected line: 0
  785. -- icon id / first selected line: 126 / 126
  786. -- text alignment: 1
  787. -- font id: 0
  788. -- text size: 12
  789. -- style flags: 0
  790. -- line height: 16
  791. -- part name: Illustration
  792. ----- HyperTalk script -----
  793. on mouseUp
  794.   if bg fld "menuList" is empty then
  795.     hide bg btn "bMask"
  796.     exit mouseUp
  797.   end if
  798.   --
  799.   set cursor to busy
  800.   if visible of bg field "xreflist" is true then
  801.     exit mouseUp
  802.   else
  803.     if visible of bg field "menulist" is true then
  804.       hide bg field "menulist"
  805.       set hilite of me to false
  806.       hide bg button "bMask"
  807.     else
  808.       show bg button "bMask"
  809.       put 0 into mwidth
  810.       put the number of lines in bg fld "menuList" into figures
  811.       if figures > 0 then
  812.         set the style of bg fld "menuList" to rectangle
  813.         if figures = 1 then
  814.           put 322 into menutop
  815.         else
  816.           if figures = 2 then
  817.             put 306 into menutop
  818.           else
  819.             if figures = 3 then
  820.               put 290 into menutop
  821.             else
  822.               if figures = 4 then
  823.                 put 274 into menutop
  824.               else
  825.                 if figures = 5 then
  826.                   put 258 into menutop
  827.                 else
  828.                   if figures = 6 then
  829.                     put 242 into menutop
  830.                   else
  831.                     if figures = 7 then
  832.                       put 226 into menutop
  833.                     else
  834.                       if figures = 8 then
  835.                         put 210 into menutop
  836.                       else
  837.                         if figures = 9 then
  838.                           put 194 into menutop
  839.                         else
  840.                           if figures = 10 then
  841.                             put 178 into menutop
  842.                           else
  843.                             put 178 into menutop
  844.                             put 16 into mwidth
  845.                             set the style of bg fld "menuList" to scrolling
  846.                             set the scroll of bg fld "menuList" to 0
  847.                           end if -- 10
  848.                         end if -- 9
  849.                       end if -- 8
  850.                     end if -- 7
  851.                   end if -- 6
  852.                 end if -- 5
  853.               end if -- 4
  854.             end if -- 3
  855.           end if -- 2
  856.         end if -- 1
  857.         set the rect of bg fld "menulist" to 348,menutop,418 + mwidth,341
  858.         set hilite of bg button "Illustration" to true
  859.         show bg field "menuList"
  860.       end if -- > 0
  861.     end if -- menulist active
  862.   end if -- xref active
  863. end mouseUp
  864.  
  865.  
  866. -- part 108 (button)
  867. -- low flags: 00
  868. -- high flags: 0004
  869. -- rect: left=294 top=316 right=341 bottom=319
  870. -- title width / last selected line: 0
  871. -- icon id / first selected line: 124 / 124
  872. -- text alignment: 1
  873. -- font id: 0
  874. -- text size: 12
  875. -- style flags: 0
  876. -- line height: 16
  877. -- part name: Help
  878. ----- HyperTalk script -----
  879. on mouseUp
  880.   if bg fld "xrefList" is empty then
  881.     hide bg btn "bMask"
  882.     exit mouseUp
  883.   end if
  884.   --
  885.   set cursor to busy
  886.   if visible of bg field "menulist" is true then
  887.     exit mouseUp
  888.   else
  889.     if visible of bg field "xreflist" is true then
  890.       hide bg field "xreflist"
  891.       set hilite of me to false
  892.       hide bg button "bMask"
  893.     else
  894.       show bg button "bMask"
  895.       put 322 into menutop
  896.       put the number of lines in bg fld "xrefList" into xrefs
  897.       -- get the longest width for menuwidth
  898.       put 0 into longstr
  899.       repeat with j = 1 to xrefs
  900.         if (stringwidth(line j of bg fld "xrefList")) > longstr then
  901.           put stringwidth(line j of bg fld "xrefList") into longstr
  902.         else
  903.           next repeat
  904.         end if
  905.       end repeat
  906.       put 328 + longstr into menuwidth -- start + 1 char + longest str
  907.       --
  908.       if xrefs > 0 then
  909.         set the style of bg fld "xrefList" to rectangle
  910.         if xrefs = 1 then
  911.           put 322 into menutop
  912.         else
  913.           if xrefs = 2 then
  914.             put 306 into menutop
  915.           else
  916.             if xrefs = 3 then
  917.               put 290 into menutop
  918.             else
  919.               if xrefs = 4 then
  920.                 put 274 into menutop
  921.               else
  922.                 if xrefs = 5 then
  923.                   put 258 into menutop
  924.                 else
  925.                   if xrefs = 6 then
  926.                     put 242 into menutop
  927.                   else
  928.                     if xrefs = 7 then
  929.                       put 226 into menutop
  930.                     else
  931.                       if xrefs = 8 then
  932.                         put 210 into menutop
  933.                       else
  934.                         if xrefs = 9 then
  935.                           put 194 into menutop
  936.                         else
  937.                           if xrefs = 10 then
  938.                             put 178 into menutop
  939.                           else
  940.                             put 178 into menutop
  941.                             set the style of bg fld "xrefList" to scrolling
  942.                             set the scroll of bg fld "xrefList" to 0
  943.                             add 20 to menuwidth
  944.                           end if -- 10
  945.                         end if -- 9
  946.                       end if -- 8
  947.                     end if -- 7
  948.                   end if -- 6
  949.                 end if -- 5
  950.               end if -- 4
  951.             end if -- 3
  952.           end if -- 2
  953.         end if -- 1
  954.         set the rect of bg fld "xreflist" to 318,menutop,menuwidth,341
  955.         set hilite of bg button "Help" to true
  956.         show bg field "xrefList"
  957.       end if -- > 0
  958.     end if -- xref active
  959.   end if -- illustrations active
  960. end mouseUp
  961.  
  962.  
  963.  
  964.  
  965. -- part 99 (field)
  966. -- low flags: 81
  967. -- high flags: 0002
  968. -- rect: left=348 top=322 right=341 bottom=418
  969. -- title width / last selected line: 0
  970. -- icon id / first selected line: 0 / 0
  971. -- text alignment: 0
  972. -- font id: 0
  973. -- text size: 12
  974. -- style flags: 0
  975. -- line height: 16
  976. -- part name: menuList
  977. ----- HyperTalk script -----
  978. on mouseUp
  979.   global thePict
  980.   if the style of bg fld "menuList" = "rectangle" then
  981.     put lineClicked(5) into lineClicked
  982.   else
  983.     put scrollLineClicked(5) into lineClicked
  984.   end if
  985.   selectlinexcmd the name of me,lineClicked
  986.   put "Tech Note" && char 1 to 3 of bg field "Number" && "- Figure" && lineClicked into thePict
  987.   hide bg field "menuList"
  988.   set hilite of bg button "Illustration" to false
  989.   hide bg button "bMask"
  990.   displayPict thePict
  991. end mouseUp
  992.  
  993.  
  994. -- part 113 (field)
  995. -- low flags: 81
  996. -- high flags: 0002
  997. -- rect: left=318 top=290 right=341 bottom=453
  998. -- title width / last selected line: 0
  999. -- icon id / first selected line: 0 / 0
  1000. -- text alignment: 0
  1001. -- font id: 0
  1002. -- text size: 12
  1003. -- style flags: 0
  1004. -- line height: 16
  1005. -- part name: xrefList
  1006. ----- HyperTalk script -----
  1007. on mouseUp
  1008.   global theXRef
  1009.   if the style of bg fld "xrefList" = "rectangle" then
  1010.     put lineClicked(5) into lineClicked
  1011.   else
  1012.     put scrollLineClicked(5) into lineClicked
  1013.   end if
  1014.   selectlinexcmd the name of me,lineClicked
  1015.   set cursor to busy
  1016.   put line lineClicked of me into theXref
  1017.   --
  1018.   if word 1 of theXref = "Technical" then
  1019.     delete char 1 of word 3 of theXref
  1020.     hide bg field "xrefList"
  1021.     set hilite of bg button "Help" to false
  1022.     hide bg button "bMask"
  1023.     put findTechNote(word 3 of theXref) into theXref
  1024.     if theXref is not empty then
  1025.       visual effect dissolve fast
  1026.       go card theXref
  1027.     else
  1028.       answer "Can't find requested X-Ref" with "OK"
  1029.     end if
  1030.   else
  1031.     if theXref = "Q & A Stack" then
  1032.       hide bg field "xrefList"
  1033.       set hilite of bg button "Help" to false
  1034.       hide bg button "bMask"
  1035.       xref theXref
  1036.     else
  1037.       -- must be a SpInside Mac Reference
  1038.       hide bg field "xrefList"
  1039.       set hilite of bg button "Help" to false
  1040.       hide bg button "bMask"
  1041.       xref theXref
  1042.     end if
  1043.   end if
  1044. end mouseUp
  1045.